﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Demo.Mmose.Core.Entity.Creature;
using Demo.Mmose.Core.Entity.GameObject;

namespace Demo.Mmose.Core.Entity.Suit.Quest
{
    /// <summary>
    /// 
    /// </summary>
    public static class QuestAction
    {
        #region zh-CHS 共有属性 | en Public Properties

        #region zh-CHS 私有成员变量 | en Private Member Variables
        /// <summary>
        /// 
        /// </summary>
        private static QuestHandlers s_QuestHandlers = new QuestHandlers();
        #endregion
        /// <summary>
        ///  
        /// </summary>
        public static QuestHandlers QuestHandlers
        {
            get { return s_QuestHandlers; }
        }

        /// <summary>
        /// 初始化
        /// </summary>
        public static void Init( QuestHandlers questHandlers )
        {
            if ( questHandlers == null )
                throw new Exception( "QuestAction.Init(...) - questHandlers == null error!" );

            s_QuestHandlers = questHandlers;
        }

        #endregion

        #region zh-CHS 共有静态方法 | en Public Static Methods

        /// <summary>
        /// 任务开始
        /// </summary>
        /// <param name="questId"></param>
        /// <param name="Quest"></param>
        public static void QuestStarted( long questId, Quest quest )
        {
            //QuestActionHandler questActionHandler = s_QuestHandlers.GetHandler( questId );
            //if ( questActionHandler != null )
            //    questActionHandler.QuestStarted( quest );
        }

        /// <summary>
        /// 任务结束
        /// </summary>
        /// <param name="Quest"></param>
        public static void QuestFinished( long questId, Quest quest )
        {
            //QuestActionHandler questActionHandler = s_QuestHandlers.GetHandler( questId );
            //if ( questActionHandler != null )
            //    questActionHandler.QuestFinished( quest );
        }

        /// <summary>
        /// 任务取消
        /// </summary>
        /// <param name="quest"></param>
        /// <param name="failed"></param>
        public static void QuestCancelled( long questId, Quest quest )
        {
            //QuestActionHandler questActionHandler = s_QuestHandlers.GetHandler( questId );
            //if ( questActionHandler != null )
            //    questActionHandler.QuestCancelled( quest );
        }

        /// <summary>
        /// 任务完成
        /// </summary>
        /// <param name="quest"></param>
        /// <param name="failed"></param>
        public static void QuestCompleted( long questId, Quest quest )
        {
            //QuestActionHandler questActionHandler = s_QuestHandlers.GetHandler( questId );
            //if ( questActionHandler != null )
            //    questActionHandler.QuestCancelled( quest );
        }

        /// <summary>
        /// 检查任务是否可用
        /// </summary>
        /// <param name="quest"></param>
        /// <param name="failed"></param>
        public static QuestInvalidReason CheckRequestQuest( long questId, Quest quest )
        {
            //QuestActionHandler questActionHandler = s_QuestHandlers.GetHandler( questId );
            //if ( questActionHandler != null )
            //    return questActionHandler.CheckRequestQuest( quest );
            //else
                return QuestInvalidReason.NONE;
        }

        /// <summary>
        /// 检查可用任务的状态
        /// </summary>
        /// <param name="quest"></param>
        /// <param name="failed"></param>
        public static QuestStatus CheckActiveQuest( long questId, Quest quest )
        {
            //QuestActionHandler questActionHandler = s_QuestHandlers.GetHandler( questId );
            //if ( questActionHandler != null )
            //    return questActionHandler.CheckActiveQuest( quest );
            //else
                return QuestStatus.NONE;
        }

        /// <summary>
        /// 检查任务是否有效
        /// </summary>
        /// <param name="quest"></param>
        /// <param name="failed"></param>
        public static bool CheckQuest( long questId, Quest quest )
        {
            //QuestActionHandler questActionHandler = s_QuestHandlers.GetHandler( questId );
            //if ( questActionHandler != null )
            //    return questActionHandler.CheckQuest( quest );
            //else
                return false;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="quest"></param>
        /// <param name="npc"></param>
        public static void NPCInteracted( long questId, Quest quest, CreatureBase npc )
        {
            //QuestActionHandler questActionHandler = s_QuestHandlers.GetHandler( questId );
            //if ( questActionHandler != null )
            //    questActionHandler.NPCInteracted( quest, npc );
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="quest"></param>
        /// <param name="gameObject"></param>
        public static void GameObjectInteraction( long questId, Quest quest, GameObjectBase gameObject )
        {
            //QuestActionHandler questActionHandler = s_QuestHandlers.GetHandler( questId );
            //if ( questActionHandler != null )
            //    questActionHandler.GameObjectInteraction( quest, gameObject );
        }

        #endregion
    }
}
